-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of items inside a doc(hidden)
block
#107000
Fix handling of items inside a doc(hidden)
block
#107000
Conversation
6184894
to
6921740
Compare
6921740
to
2db19cd
Compare
tests/rustdoc/redirect.rs
Outdated
// @has - '//p/a' '../../reexp_stripped/struct.Bar.html' | ||
// `Bar` is in a `doc(hidden)` module so the link should point to a non-existing file. | ||
// However, the struct is reexported at the root of the crate so we should point to it. | ||
// @has - '//a[@href="../reexp_stripped/struct.Bar.html"]' 'Bar' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this test is failing. I need to find out why we generate a link to the original location of the item and not to the reexport directly.
This comment has been minimized.
This comment has been minimized.
2db19cd
to
5e4bb11
Compare
So now just remains to fix the mystery of the bad item linking. |
This comment has been minimized.
This comment has been minimized.
tests/rustdoc/hidden-private.rs
Outdated
} | ||
|
||
// @has 'foo/struct.Private.html' | ||
// @!has - '//*[@id="impl-Bar-for-Private"]/*[@class="code-header"]' 'impl Bar for Private' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this hidden? It means that If have a private type, and use #[derive(Serialize)]
, the impl won't appear with --document-private-items
, which seems undesirable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly the discussion we had here. If something is inside a hidden item's descendants, then it doesn't appear (not private, hidden).
5e4bb11
to
e42fc33
Compare
This comment has been minimized.
This comment has been minimized.
55ace15
to
0a8d69f
Compare
So I just pushed a new commit which changes a bit in case the item is reexported how its URL is computed. This is a change that needs to be very carefully reviewed. I'm not sure if this was the right approach to the problem so if someone has another idea in mind that allows to not change how some URLs are generated, it'd be really awesome! |
This comment has been minimized.
This comment has been minimized.
0a8d69f
to
0de90bd
Compare
Fixed the bug! \o/ The problem was that I was removing the item with |
This comment has been minimized.
This comment has been minimized.
0de90bd
to
6362019
Compare
Ok, I forgot to recurse into hidden children. Fixed that too. |
This comment has been minimized.
This comment has been minimized.
6362019
to
302c75f
Compare
…iddle rustdoc: Revert rust-lang#104889 Reverts rust-lang#104889. I don't think I'll be able to finish rust-lang#107000 on time unfortunately so to prevent rust-lang#106373, better to revert it and to make it into the next release. r? `@notriddle`
This comment was marked as resolved.
This comment was marked as resolved.
302c75f
to
61ce752
Compare
16d81dc
to
ea84418
Compare
The implementation is now in line with the rest of the implementation blocks handling in rustdoc. Ready for new review round. |
Forgot to change status... @bors ready |
@bors r=notriddle,petrochenkov rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (6c991b0): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
This bug isn’t going to be fixed without some kind of perf regression, because it just has to walk through more of the AST. It happened last time for the same reason. #104889 (comment) |
Agree with @notriddle @rustbot label: +perf-regression-triaged |
Fixes #106373.
cc @aDotInTheVoid
r? @notriddle